// src/course_offering/dto/query-course-offering.dto.ts
import { IsInt, IsString, IsEnum, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class QueryCourseOfferingDto {
    @ApiProperty({ description: '学期ID', required: false })
    @IsInt()
    @IsOptional()
    semester_id?: number;

    @ApiProperty({ description: '课程编号', required: false })
    @IsInt()
    @IsOptional()
    cno?: number;

    @ApiProperty({ description: '教师编号', required: false })
    @IsInt()
    @IsOptional()
    tno?: number;

    @ApiProperty({ description: '课程状态', enum: ['open', 'closed', 'cancelled'], required: false })
    @IsEnum(['open', 'closed', 'cancelled'])
    @IsOptional()
    status?: string;

    @ApiProperty({ description: '页码', required: false, default: 1 })
    @IsInt()
    @IsOptional()
    page?: number = 1;

    @ApiProperty({ description: '每页数量', required: false, default: 10 })
    @IsInt()
    @IsOptional()
    pageSize?: number = 10;
}